#include "colour.h"

Colour::Colour()
{
	this->m_fRed = 0;
	this->m_fGreen = 0;
	this->m_fBlue = 0;
}

Colour::Colour(int Red, int Green, int Blue)
{
	this->m_fRed = Red / 255.0f;
	this->m_fGreen = Green / 255.0f;
	this->m_fBlue = Blue / 255.0f;
}
	
Colour::Colour(float Red, float Green, float Blue)
{
	this->m_fRed = Red;
	this->m_fGreen = Green;
	this->m_fBlue = Blue;
}

Colour::~Colour()
{
}

float Colour::Red()
{
	return this->m_fRed;
}

float Colour::Green()
{
	return this->m_fGreen;
}

float Colour::Blue()
{
	return this->m_fBlue;
}

int Colour::GetIntRed()
{
	return (int)this->m_fRed * 255;
}

int Colour::GetIntGreen()
{
	return (int)this->m_fGreen * 255;
}

int Colour::GetIntBlue()
{
	return (int)this->m_fBlue * 255;
}

void Colour::SetRed(int Red)
{
	if(Red > 255) Red = 255;
	if(Red < 0) Red = 0;

	this->m_fRed = Red / 255.0f;
}

void Colour::SetRed(float Red)
{
	if(Red > 1.0f) Red = 1.0f;
	if(Red < 0.0f) Red = 0.0f;

	this->m_fRed = Red;
}

void Colour::SetGreen(int Green)
{
	if(Green > 255) Green = 255;
	if(Green < 0) Green = 0;

	this->m_fGreen = Green / 255.0f;

}

void Colour::SetGreen(float Green)
{
	if(Green > 1.0f) Green = 1.0f;
	if(Green < 0.0f) Green = 0.0f;

	this->m_fGreen = Green;
}

void Colour::SetBlue(int Blue)
{
	if(Blue > 255) Blue = 255;
	if(Blue < 0) Blue = 0;

	this->m_fBlue = Blue / 255.0f;
}

void Colour::SetBlue(float Blue)
{
	if(Blue > 1.0f) Blue = 1.0f;
	if(Blue < 0.0f) Blue = 0.0f;

	this->m_fBlue = Blue;
}

void Colour::SetRGB(int Red, int Green, int Blue)
{
	SetRed(Red);
	SetGreen(Green);
	SetBlue(Blue);
}

void Colour::SetRGB(float Red, float Green, float Blue)
{
	SetRed(Red);
	SetGreen(Green);
	SetBlue(Blue);
}
